package com.TwinBlade.PicturePassword;

import android.content.Context;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ScaleGestureDetector;
import android.view.View.MeasureSpec;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class TouchImageView extends ImageView
{
  int a = 0;
  public int b;
  public int c;
  protected float d;
  protected float e;
  private Matrix f;
  private PointF g = new PointF();
  private PointF h = new PointF();
  private float i = 1.0F;
  private float j = 3.0F;
  private float[] k;
  private float l = 1.0F;
  private int m;
  private ScaleGestureDetector n;

  public TouchImageView(Context paramContext)
  {
    super(paramContext);
    a(paramContext);
  }

  public TouchImageView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    a(paramContext);
  }

  private void a(Context paramContext)
  {
    super.setClickable(true);
    this.n = new ScaleGestureDetector(paramContext, new cu(this, null));
    this.f = new Matrix();
    this.k = new float[9];
    setImageMatrix(this.f);
    setScaleType(ImageView.ScaleType.MATRIX);
    setOnTouchListener(new ct(this));
  }

  float a(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    float f2;
    float f1;
    float f3;
    if (paramFloat3 <= paramFloat2)
    {
      f2 = paramFloat2 - paramFloat3;
      f1 = 0.0F;
      if (paramFloat1 >= f1)
        break label42;
      f3 = f1 + -paramFloat1;
    }
    label42: boolean bool;
    do
    {
      return f3;
      f1 = paramFloat2 - paramFloat3;
      f2 = 0.0F;
      break;
      bool = paramFloat1 < f2;
      f3 = 0.0F;
    }
    while (!bool);
    return f2 + -paramFloat1;
  }

  void a()
  {
    this.f.getValues(this.k);
    float f1 = this.k[2];
    float f2 = this.k[5];
    float f3 = a(f1, this.b, this.d * this.l);
    float f4 = a(f2, this.c, this.e * this.l);
    if ((f3 != 0.0F) || (f4 != 0.0F))
      this.f.postTranslate(f3, f4);
  }

  float b(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    if (paramFloat3 <= paramFloat2)
      paramFloat1 = 0.0F;
    return paramFloat1;
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    super.onMeasure(paramInt1, paramInt2);
    this.b = View.MeasureSpec.getSize(paramInt1);
    this.c = View.MeasureSpec.getSize(paramInt2);
    if (((this.m == this.b) && (this.m == this.c)) || (this.b == 0) || (this.c == 0));
    Drawable localDrawable;
    do
    {
      return;
      this.m = this.c;
      if (this.l != 1.0F)
        break;
      localDrawable = getDrawable();
    }
    while ((localDrawable == null) || (localDrawable.getIntrinsicWidth() == 0) || (localDrawable.getIntrinsicHeight() == 0));
    int i1 = localDrawable.getIntrinsicWidth();
    int i2 = localDrawable.getIntrinsicHeight();
    float f1 = Math.max(this.b / i1, this.c / i2);
    this.f.setScale(f1, f1);
    float f2 = this.c - f1 * i2;
    float f3 = this.b - f1 * i1;
    float f4 = f2 / 2.0F;
    float f5 = f3 / 2.0F;
    this.f.postTranslate(f5, f4);
    this.d = (this.b - f5 * 2.0F);
    this.e = (this.c - f4 * 2.0F);
    setImageMatrix(this.f);
    a();
  }

  public void setMaxZoom(float paramFloat)
  {
    this.j = paramFloat;
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.TouchImageView
 * JD-Core Version:    0.6.2
 */